package com.example.last.service;


import com.example.last.dao.LogDao;
import com.example.last.entity.Log;
import com.example.last.entity.Params;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LogService {
    @Resource
    private LogDao logDao;

    public PageInfo<Log> findBySearch(@Param("Params") Params params) {
        PageHelper.startPage(params.getPageNum(),params.getPageSize());
        List<Log> list =  logDao.findBySearch(params);
        return PageInfo.of(list);
    }

    public void add(Log log) {
        logDao.add(log);
    }

    public void delete(Integer id) {
        logDao.delete(id);
    }



}
